home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1370 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  47 lines

  1. Newsgroups: comp.lang.c
  2. Path: gail.ripco.com!mambuhl
  3. From: mambuhl@ripco.com (Martin Ambuhl)
  4. Subject: Re: Locaton of an array? 
  5. X-Nntp-Posting-Host: foley.ripco.com
  6. Message-ID: <DL3u9u.9yJ@rci.ripco.com>
  7. Sender: usenet@rci.ripco.com (Net News Admin)
  8. Organization: Ripco Internet BBS Chicago
  9. Date: Sat, 13 Jan 1996 05:37:06 GMT
  10. X-Ident-Sender: mambuhl
  11.  
  12. maverick@netcom.com (Chris Shepard)
  13. in <maverickDL1u3x.45I@netcom.com> wrote:
  14.  
  15. >#include <the usual stuff>
  16.  
  17. /* just so he'll know: */
  18. #include <stdio.h>  /* for printf */
  19. #include <stdlib.h> /* for EXIT_SUCCESS */
  20.  
  21. >int main(void)
  22. >{
  23. >        char arr[10],
  24. >                  *p;
  25.  
  26. >        p=arr;
  27. >        printf("addr of arr = %p\n",p);
  28.                                     ^^^
  29.                                  (void *)p
  30.  
  31. >        return(EXIT_SUCCESS);
  32. >}
  33.  
  34. More trivially:
  35.  
  36. #include <stdio.h>
  37. int main(void)
  38. {
  39.     char arr[10];
  40.     printf("ptr to arr = %p\n",(void *)arr);
  41.     return 0;
  42. }
  43.                                                    
  44. --
  45. * Martin Ambuhl       net: mambuhl@ripco.com
  46. * Chicago, IL (USA)    
  47.